const express = require('express')
const routerCategories = express.Router()
const categoriesHandle = require('../router_handler/categories')
    // 添加分类
routerCategories.post('/categories', categoriesHandle.addCategories)
    // 根据 id 查询分类
routerCategories.get('/categories/:id', categoriesHandle.search)
    // 编辑提交分类
routerCategories.put('/categories/:id', categoriesHandle.update)
    // 删除分类
routerCategories.delete('/categories/:id', categoriesHandle.delete)
    // 商品分类数据列表
routerCategories.get('/categories', categoriesHandle.getCategories)
    // 删除参数
routerCategories.delete('/categories/:id/attributes/:attrId', categoriesHandle.cateDelete)
    // 根据 ID 查询参数
routerCategories.get('/categories/:id/attributes/:attrId', categoriesHandle.cateSearch)
    // 编辑提交参数
routerCategories.put('/categories/:id/attributes/:attrId', categoriesHandle.cateUpdate)
    // 参数列表
routerCategories.get('/categories/:id/attributes', categoriesHandle.getAttributes)
    // 添加动态参数或者静态属性
routerCategories.post('/categories/:id/attributes', categoriesHandle.addAttributes)
module.exports = routerCategories